import { List, Image } from 'antd-mobile'
import { useNavigate } from "react-router-dom"
function OrdinaryBeing({childRef}) {
    const navigate = useNavigate()
    const skipPage = () => {
        if (localStorage.getItem("token")) {
            navigate("/questionAnsweringManagement")
        } else {
            window.location.href = "/login"
        }

    }
    const fatherRef = (val) => {
        console.log("childRef",val)
    }
    childRef(fatherRef)
    return (
        <div>
            {/* 功能中心 */}
            <div className="center">
                <div className="center-title">功能中心</div>
                <div className="center-gzt">
                    <img src={require("@/assets/home/mine_gongzuotai_beij@2.png")} alt="" />
                    <img src={require("@/assets/home/mine_shejijingxuan_beij@2.png")} alt="" />
                </div>
                <div>
                    <div>
                        <List>
                            <List.Item prefix={
                                <Image
                                    src={require("@/assets/home/mine_user_shoppingcart_icon@2.png")}
                                    fit='cover'
                                    width={20}
                                    height={20}
                                />
                            } onClick={() => skipPage()}>购物中心</List.Item>
                            <List.Item prefix={
                                <Image
                                    src={require("@/assets/home/mine_user_novice_introduction_icon@2.png")}
                                    fit='cover'
                                    width={20}
                                    height={20}
                                />
                            } onClick={() => skipPage()}>问答管理</List.Item>
                            <List.Item prefix={
                                <Image
                                    src={require("@/assets/home/mine_user_settled_platform_icon@2.png")}
                                    //  style={{ borderRadius: 20 }}
                                    fit='cover'
                                    width={20}
                                    height={20}
                                />
                            } onClick={() => skipPage()}>入驻平台</List.Item>
                            <List.Item prefix={
                                <Image
                                    src={require("@/assets/home/mine_user_content20_icon@2.png")}
                                    //  style={{ borderRadius: 20 }}
                                    fit='cover'
                                    width={20}
                                    height={20}
                                />
                            } onClick={() => skipPage()}>内容管理</List.Item>
                            <List.Item prefix={
                                <Image
                                    src={require("@/assets/home/mine_user_novice_introduction_icon@2 (1).png")}
                                    //  style={{ borderRadius: 20 }}
                                    fit='cover'
                                    width={20}
                                    height={20}
                                />
                            } onClick={() => skipPage()}>新手攻略</List.Item>
                        </List>
                    </div>
                </div>
            </div>
        </div>
    )
}

export default OrdinaryBeing